home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / asin.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.6 KB  |  46 lines

  1. <!--- This example shows how to use ASin --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. ASin Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  10.  
  11. <BODY  bgcolor="#FFFFD5">
  12.  
  13. <H3>ASin Example</H3>
  14. <!--- output its arcsine value --->
  15. <CFIF IsDefined("form.SinNum")>
  16.     <CFIF IsNumeric(form.SinNum)>
  17.         <CFIF form.SinNum LESS THAN OR EQUAL TO 1>
  18.             <CFIF form.SinNum GREATER THAN OR EQUAL TO -1>
  19.                 ASin(<CFOUTPUT>#form.SinNum#</CFOUTPUT>) =
  20.                   <CFOUTPUT>#Evaluate(ASin(form.sinNum))# Radians</CFOUTPUT>
  21.                   <BR>
  22.                   or
  23.                   <BR>ASin(<CFOUTPUT>#form.SinNum#</CFOUTPUT>) =
  24.                   <CFOUTPUT>#Evaluate(ASin(form.sinNum) * 180/Pi())# Degrees</CFOUTPUT>
  25.             <CFELSE>
  26. <!--- if it is less than negative one, output an error message --->
  27.             <H4>Please enter the sine of the angle that is to be calculated in degrees and radians. This value must be between 1 and -1, inclusive.</H4>
  28.             </CFIF>
  29.         <CFELSE>
  30. <!--- if it is greater than one, output an error message --->
  31.         <H4>Please enter the sine of the angle that is to be calculated in degrees and radians. This value must be between 1 and -1, inclusive.</H4>
  32.         </CFIF>        
  33.     <CFELSE>
  34. <!--- if it is empty, output an error message --->
  35.         <H4>Please enter the sine of the angle that is to be calculated in degrees and radians. This value must be between 1 and -1, inclusive.</H4>    
  36.     </CFIF>    
  37. </CFIF>
  38.  
  39. <FORM ACTION="asin.cfm" METHOD="POST">
  40. <P>Type in a number to get its arcsine in Radians and Degrees.
  41. <BR><INPUT TYPE="Text" NAME="sinNum" SIZE="25">
  42. <P><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
  43. </FORM>
  44.  
  45. </BODY>
  46. </HTML>